package com.ghxxzx.daglcustom.vo;

public class ResultEntity {
    private Integer code;
    private String mess;
    private Object data;
    public ResultEntity(Integer code, String mess){
        this.code = code;
        this.mess = mess;
    }

    public ResultEntity(Integer code){
        this.code=code;
    }

    public ResultEntity(Integer code, Object data){
        this.code=code;
        this.data = data;
    }

    public ResultEntity(){}


    public ResultEntity(Integer code, String mess, Object data){
        this.code = code;
        this.mess = mess;
        this.data = data;
    }

    public static ResultEntity ok(){
        ResultEntity resultEntity = new ResultEntity(200);
        return resultEntity;
    }

    public static ResultEntity error(String mess){
        ResultEntity resultEntity = new ResultEntity(500,mess);
        return resultEntity;
    }

    public static ResultEntity ok(Object data){
        ResultEntity resultEntity = new ResultEntity(200,data);
        return resultEntity;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMess() {
        return mess;
    }

    public void setMess(String mess) {
        this.mess = mess;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
